package mylibrary.designPattern.proxy.jdk_dynamic;

import java.lang.reflect.Proxy;

public class Run {

	public static void main(String[] args) {
		
		Test t = new TestImpl();
		
		TestHandle th = new TestHandle(t);
		
		Test proxy = (Test) Proxy.newProxyInstance(t.getClass().getClassLoader(), t.getClass().getInterfaces(), th);
		
		int i = (int)proxy.doSth();
		
		System.out.println(i);
		
	}
}
